<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>

<h1>Blog List</h1>


<div id="blogs">
	<c:if test="${!empty blogList}">
	<h2>Current Blogs</h2>
	<table class="summary">
		<thead>
			<tr>
				<th>Title</th>
				<th>Catalog</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach var="blog" items="${blogList}">
			<tr>
				<td>
					<a href="<c:url value="/users/${blog.userId}/blogs/${blog.id}" />"><c:out value="${blog.title}" escapeXml="true" /></a>
				</td>
				<td><c:out value="${blog.catalog.name}" escapeXml="true" /><br/></td>
			</tr>
			</c:forEach>
		</tbody>
	</table>
	</c:if>
</div>
